package archsw0904.controller.shopping.order;

public class OrderBeanProxy implements archsw0904.controller.shopping.order.OrderBean {
  private String _endpoint = null;
  private archsw0904.controller.shopping.order.OrderBean orderBean = null;
  
  public OrderBeanProxy() {
    _initOrderBeanProxy();
  }
  
  public OrderBeanProxy(String endpoint) {
    _endpoint = endpoint;
    _initOrderBeanProxy();
  }
  
  private void _initOrderBeanProxy() {
    try {
      orderBean = (new archsw0904.controller.shopping.order.OrderBeanServiceLocator()).getOrderBeanPort();
      if (orderBean != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)orderBean)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)orderBean)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (orderBean != null)
      ((javax.xml.rpc.Stub)orderBean)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public archsw0904.controller.shopping.order.OrderBean getOrderBean() {
    if (orderBean == null)
      _initOrderBeanProxy();
    return orderBean;
  }
  
  public void checkHomeDelivery(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3, java.lang.String arg4, java.lang.String arg5) throws java.rmi.RemoteException, archsw0904.controller.shopping.order.NullMandatoryFieldException{
    if (orderBean == null)
      _initOrderBeanProxy();
    orderBean.checkHomeDelivery(arg0, arg1, arg2, arg3, arg4, arg5);
  }
  
  public archsw0904.controller.shopping.order.Orders createOrder(java.lang.Integer arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3, java.lang.String arg4, java.lang.String arg5, java.lang.String arg6) throws java.rmi.RemoteException, archsw0904.controller.shopping.order.IOException, archsw0904.controller.shopping.order.HttpException, archsw0904.controller.shopping.order.InvalidCartException, archsw0904.controller.shopping.order.NullMandatoryFieldException{
    if (orderBean == null)
      _initOrderBeanProxy();
    return orderBean.createOrder(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
  }
  
  public archsw0904.controller.shopping.order.Cart findCart(java.lang.Integer arg0) throws java.rmi.RemoteException, archsw0904.controller.shopping.order.InvalidCartException{
    if (orderBean == null)
      _initOrderBeanProxy();
    return orderBean.findCart(arg0);
  }
  
  public int getBookList(java.lang.Integer arg0) throws java.rmi.RemoteException, archsw0904.controller.shopping.order.CartException{
    if (orderBean == null)
      _initOrderBeanProxy();
    return orderBean.getBookList(arg0);
  }
  
  public archsw0904.controller.shopping.order.OrderView[] getOrderView(java.lang.Integer arg0) throws java.rmi.RemoteException{
    if (orderBean == null)
      _initOrderBeanProxy();
    return orderBean.getOrderView(arg0);
  }
  
  
}